/*
 * FaceCat图形通讯框架
 * 著作权编号:2015SR229355+2020SR0266727
 * 上海卷卷猫信息技术有限公司
 */

using System;

namespace FaceCat {
    /// <summary>
    /// 视图管理
    /// </summary>
    public abstract class FCHost {
        /// <summary>
        /// 获取是否允许操作
        /// </summary>
        public abstract bool allowOperate();

        /// <summary>
        /// 设置是否允许操作
        /// </summary>
        public abstract void setAllowOperate(bool value);

        /// <summary>
        /// 获取是否允许局部绘图
        /// </summary>
        public abstract bool allowPartialpaint();

        /// <summary>
        /// 设置是否允许局部绘图
        /// </summary>
        public abstract void setAllowPartialPaint(bool value);

        /// <summary>
        /// 是否被删除
        /// </summary>
        /// <returns></returns>
        public abstract bool isDeleted();

        /// <summary>
        /// 获取方法库
        /// </summary>
        public abstract FCNative getNative();

        /// <summary>
        /// 设置方法库
        /// </summary>
        public abstract void setNative(FCNative value);

        /// <summary>
        /// 在视图的线程中调用方法
        /// </summary>
        /// <param name="view">视图</param>
        /// <param name="args">参数</param>
        public abstract void beginInvoke(FCView view, Object args);

        /// <summary>
        /// 复制文本
        /// </summary>
        /// <param name="text">文本</param>
        public abstract void copy(String text);

        /// <summary>
        /// 销毁资源
        /// </summary>
        public abstract void delete();

        /// <summary>
        /// 创建内部视图
        /// </summary>
        /// <param name="parent">父视图</param>
        /// <param name="clsid">类型ID</param>
        /// <returns>视图</returns>
        public abstract FCView createInternalView(FCView parent, String clsid);

        /// <summary>
        /// 获取光标
        /// </summary>
        /// <returns>光标</returns>
        public abstract FCCursors getCursor();

        /// <summary>
        /// 获取矩形相交区
        /// </summary>
        /// <param name="lpDestRect">相交矩形</param>
        /// <param name="lpSrc1Rect">矩形1</param>
        /// <param name="lpSrc2Rect">矩形2</param>
        /// <returns>是否相交</returns>
        public abstract int getIntersectRect(ref FCRect lpDestRect, ref FCRect lpSrc1Rect, ref FCRect lpSrc2Rect);

        /// <summary>
        /// 获取尺寸
        /// </summary>
        /// <returns>大小</returns>
        public abstract FCSize getSize();

        /// <summary>
        /// 获取触摸位置
        /// </summary>
        /// <returns>坐标</returns>
        public abstract FCPoint getTouchPoint();

        /// <summary>
        /// 获取矩形并集区
        /// </summary>
        /// <param name="lpDestRect">并集矩形</param>
        /// <param name="lpSrc1Rect">矩形1</param>
        /// <param name="lpSrc2Rect">矩形2</param>
        /// <returns>是否相交</returns>
        public abstract int getUnionRect(ref FCRect lpDestRect, ref FCRect lpSrc1Rect, ref FCRect lpSrc2Rect);

        /// <summary>
        /// 刷新绘图
        /// </summary>
        /// <param name="rect">区域</param>
        public abstract void invalidate(FCRect rect);

        /// <summary>
        /// 刷新绘图
        /// </summary>
        public abstract void invalidate();

        /// <summary>
        /// 在视图的线程中调用方法
        /// </summary>
        /// <param name="view">视图</param>
        /// <param name="args">参数</param>
        public abstract void invoke(FCView view, Object args);

        /// <summary>
        /// 获取按键的状态
        /// </summary>
        /// <param name="key">按键</param>
        /// <returns>状态</returns>
        public abstract bool isKeyPress(int key);

        /// <summary>
        /// 获取粘贴文本
        /// </summary>
        /// <returns>文本</returns>
        public abstract String paste();

        /// <summary>
        /// 设置光标
        /// </summary>
        /// <param name="cursor">光标</param>
        public abstract void setCursor(FCCursors cursor);

        /// <summary>
        /// 显示提示框
        /// </summary>
        /// <param name="text">文字</param>
        /// <param name="mp">位置</param>
        public abstract void showToolTip(String text, FCPoint mp);

        /// <summary>
        /// 设置触摸位置
        /// </summary>
        public abstract void setTouchPoint(FCPoint point);

        /// <summary>
        /// 开启秒表
        /// </summary>
        /// <param name="timerID">秒表ID</param>
        /// <param name="interval">间隔</param>
        public abstract void startTimer(int timerID, int interval);

        /// <summary>
        /// 停止秒表
        /// </summary>
        /// <param name="timerID">秒表ID</param>
        public abstract void stopTimer(int timerID);
    }
}
